package com.hy.controller;

import com.hy.Result.ResponseResult;
import com.hy.service.SlideshowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/slideshow")
public class SlideshowController {//小程序APP 轮播图
    @Autowired
    private SlideshowService slideshowService;

    /**
     * APP主页轮播图
     * @return ResponseResult
     */
    @GetMapping("/list")
    public ResponseResult list(){
        try {
            return slideshowService.list();
        } catch (Exception e) {
            e.printStackTrace();
            return ResponseResult.errorResult(400, "轮播图查询失败!");
        }
    }

}
